import { orderList } from "../../request/api"

const state = {
    orders: []
}
const mutations = {
    changeOrder(state, res) {
        state.orders = res;
    }
}
const actions = {
    orderListActions(context, uid) {
        orderList(uid).then(res => {
            if (res.code === 200) {
                console.log(res);
                context.commit("changeOrder", res.list)
            }
        })
    }
}
const getters = {
    orders() {
        return state.orders;
    }
}

export default {
    state,
    mutations,
    actions,
    getters,
    namespaced: true
}